<?php

use think\migration\Migrator;
use think\migration\db\Column;

class OauthRefreshTokens extends Migrator
{
    public function change()
    {
        $table = $this->table('oauth_refresh_tokens', ['id' => false]);
        $table->addColumn('id', 'string', ['limit' => 100, 'default' => ''])
            ->addColumn('access_token_id', 'string', ['limit' => 100, 'default' => ''])
            ->addColumn('revoked', 'boolean', ['limit' => 1, 'default' => 0, 'signed' => false])
            ->addColumn('expires_at', 'datetime', ['default' => null, 'null' => true])
            ->create();
    }
}
